/****** Object:  Table [dbo].[cardPayment]    ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[cardPayment](
	[cardpaymentId] [int] IDENTITY(1,1) NOT NULL,
	[bookingtId] [int] NULL,
	[paymentMethodCode] [nchar](10) NULL,
	[cardNo] [nchar](50) NULL,
	[nameOnCard] [nchar](50) NULL,
	[cardTypeCode] [nchar](10) NULL,
	[cardexpiryDate] [date] NULL,
	[paidAmount] [float] NULL,
 CONSTRAINT [PK_cardPayment] PRIMARY KEY CLUSTERED 
(
	[cardpaymentId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[cardPayment]  WITH CHECK ADD  CONSTRAINT [FK_cardPayment_booking] FOREIGN KEY([bookingtId])
REFERENCES [dbo].[booking] ([bookingId])
GO

ALTER TABLE [dbo].[cardPayment] CHECK CONSTRAINT [FK_cardPayment_booking]
GO

ALTER TABLE [dbo].[cardPayment]  WITH CHECK ADD  CONSTRAINT [FK_cardPayment_cardType] FOREIGN KEY([cardTypeCode])
REFERENCES [dbo].[cardType] ([cardTypeCode])
GO

ALTER TABLE [dbo].[cardPayment] CHECK CONSTRAINT [FK_cardPayment_cardType]
GO

ALTER TABLE [dbo].[cardPayment]  WITH CHECK ADD  CONSTRAINT [FK_cardPayment_paymentMethod] FOREIGN KEY([paymentMethodCode])
REFERENCES [dbo].[paymentMethod] ([paymentMethodCode])
GO

ALTER TABLE [dbo].[cardPayment] CHECK CONSTRAINT [FK_cardPayment_paymentMethod]
GO

